<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

/**
 * Description of Controller
 * 
 * @todo 
 * 
 * @author George Zeakis<zeageorge@google.com>
 */

define("MODELS", "SOME FOLDER WITH MODELS");


class Controller {
	function __construct() {
            $this->view = new View();
            return true;
        }
        
	public function loadModel($name) {
		$path = MODELS.$name.'_model.php';
		if (file_exists($path)) {
                    require $path;
                    $modelName = $name . '_Model';
                    $this->model = new $modelName();
                    return true;
		} else {
                    throw new Exception("Model name: $modelName does not exists.");
                    //return false;
                }		
	}
}